<template>
  <div>
    <div class="return" v-if="clientId" @click="back">
      <img class="backImg" src="@/assets/images/back.png" alt />
    </div>
    <div class="conMsg">
      <div class="conMsg">
        <div class="top">
          <div class="title">
            <i class="el-icon-collection-tag" />图片列表
          </div>
        </div>
        <div class="table">
          <!--列表-->
          <div class="demo-image__preview" v-if="imgsList.length">
            <div class="imgListBox" v-for="item in imgsList" :key="item.id">
              <div style="line-height: 100px;">
                  {{item.customer_name}}({{ item.telephone }})
              </div>
                <div class="itemImg ml20" v-for="(val, index) in item.img_url" :key="index">
                    <el-image 
                    style="width: 100px; height: 100px"
                    :src="val" 
                    :preview-src-list="item.img_url">
                  </el-image>
                </div>
            </div>
          </div>
          <div v-else class="notHave el-icon-picture-outline">暂无数据</div>
        </div>
        </div>
      </div>
  </div>
</template>

<script>
import { serveContentImage } from "@/api/client";

export default {
  data() {
    return {
      imgsList:[],
      redeemId:'',
      clientId:'',
    };
  },
  mounted() {
    this.clientId = this.$route.query.id
    this.redeemId = this.$route.query.redeemId
    this.tapPhoto();
  },
  created() {},
  methods: {
     tapPhoto(){
      serveContentImage({id:this.redeemId}).then(res => {
        this.imgsList = res.data;
      })
    },
 // 返回
    back() {
      console.log(11)
      const query = {
        id: this.clientId,
        activeName: "seventh",
      };
      this.$router.push({ name: "客户详情", query });
    },
  }
};
</script>

<style lang="scss" scoped>
.return {
  position: fixed;
  right: 20px;
  top: 71px;
  z-index: 999;
  .backImg {
    margin-right: 14px;
    width: 32px;
    height: 100%;
    cursor: pointer;
    vertical-align: middle;
  }
}
.conMsg {
  margin-bottom: 30px;
  .top {
    display: flex;
    justify-content: space-between;
    .title {
      font-weight: bold;
      font-size: 14px;
      line-height: 34px;
      color: #666;
    }
  }
  .table {
    border-top: 1px solid #eee;
    .rowTel {
      border: 1px solid #eee;
      border-right: 0;
      border-top: 0;
      text-align: right;
      padding-right: 30px;
      height: 50px;
      line-height: 50px;
      background: #f9fafc;
      color: #878683;
      font-size: 14px;
    }
    .rowTel2 {
      border-left: 0;
    }
    .rowCon {
      border: 1px solid #eee;
      border-top: 0;
      text-align: left;
      height: 50px;
      line-height: 50px;
      padding-left: 30px;
      background: #fff;
      color: #878683;
      font-size: 14px;
    }
  }
}
.uderMsg {
  display: flex;
  width: 100%;
  .userBox {
    // height: 252px;
    width: 200px;
    background: #fafafa;
    border: 1px solid #ebeef5;
    border-right: 0;
    text-align: center;
    padding-top: 4%;
    box-sizing: border-box;
    .userImg {
      width: 100px;
      height: 100px;
      margin: 0 auto;
      text-align: center;
      line-height: 100px;
      font-size: 16px;
      font-weight: bold;
      color: #666;
      border: 1px solid #eee;
      border-radius: 50%;
    }
    .userRank {
      background: #f04844;
      color: #fff;
      border-radius: 30px;
      width: 100px;
      height: 32px;
      margin: 20px auto 0;
      line-height: 32px;
    }
  }
  .margin-top {
    width: 100%;
  }
}
::v-deep.el-descriptions :not(.is-bordered) .el-descriptions-item__cell {
  max-width: 309px;
}
.btnBox {
  width: 100%;
  text-align: center;
}
.demo-image__preview {
  // max-height: 60vh;
  // overflow-y: scroll;

  .imgListBox {
    border-bottom: 1px solid #eee;
    padding: 20px 0;
    display: flex;
    position: relative;
  }
  .imgLeft {
    max-width: 15%;
  }
  .imgRight {
    max-width: 85%;
    display: flex;
    flex-wrap: wrap;
  }
  .btnDelImg {
    position: relative;
    right: 0px;
    bottom: 10px;
  }
  .itemImg {
    position: relative;
  }
  .itemImg .el-image {
    width: 120px;
    height: 96px;
    margin-bottom: 10px;
    border-radius: 6px;
  }
  .itemImg .el-icon-circle-close:before {
    font-size: 16px;
    position: absolute;
    right: -5px;
    top: -5px;
    z-index: 66;
    cursor: pointer;
    color: #999;
    background: rgba(255, 255, 255, 0.664);
    border-radius: 50%;
  }
  .upTime {
    font-size: 12px;
    color: #999;
    margin-bottom: 10px;
  }
}
.notHave {
  text-align: center;
  width: 100%;
  padding: 20px 0 40px;
  font-size: 16px;
}
.el-image {
  overflow: unset;
}
</style>
